<%-- 
    Document   : Map thing
    Created on : 21/08/2011, 11:23:51 AM
    Author     : Lewis Kelly
--%>

<!--NOT FOR ASSIGN TO PM, FOR ANYONE WHO NEEDS THE MAP THING        -->

        <FORM NAME=assignForm METHOD=POST ACTION="assignToPM.html">
            <!-- <label>Search: </label><input type="text" size="40"/><br /><br />
                  <input type="button" value="Assign To Poll" onclick="" />-->

            <input class="required" type="text" name="latitude" id="latitude" value="-27.49571" hidden="true" /> 
            <input class="required" type="text" name="longitude" id="longitude" value="153.012772" hidden="true" />
            <br /><br />
            <div id="map" style="width: 600px; height: 420px"></div>

            <!-- add your map api key here -->
            <script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key="></script>

            <script type="text/javascript">
               
                function returnCoords(){
                    var lat = document.assignForm.latitude.value;
                    var lng = document.assignForm.longitude.value;
                    
                    alert(''+lat+' '+lng);
                    
                    
                }
                
                <!--
                if (GBrowserIsCompatible()) 
                {
                    // create map and add controls
                    var map = new GMap2(document.getElementById("map"));
                    var customUI = map.getDefaultUI();
customUI.controls.scalecontrol = false;
map.setUI(customUI);
                    map.addControl(new GLargeMapControl());        
                    map.addControl(new GMapTypeControl());
	
                    // set centre point of map
                    var centrePoint = new GLatLng('-27.49571', '153.012772');
                    map.setCenter(centrePoint, 14);	
	
                    // add a draggable marker
                    var marker = new GMarker(centrePoint, {draggable: true});
                    
                    map.addOverlay(marker);
	
                    // add a drag listener to the map
                    GEvent.addListener(marker, "dragend", function() {
                        var point = marker.getPoint();
                        map.panTo(point);
                        document.getElementById("latitude").value = point.lat();
                        document.getElementById("longitude").value = point.lng();
                    });
                }
                //-->
            </script>
            
            <input type="submit" onclick="returnCoords()"  />


        </FORM>
<!--END OF MAP THING-->
